﻿#region Namespace References

using System;
using System.Windows.Forms;
using DynConDevCorp.OpenArch.SmartData.BillingDemo1.ApplicationBusinessObjects;
using DynConDevCorp.OpenArch.SmartData.Core;
using DynConDevCorp.OpenArch.SmartData.Interfaces.Attributes;

#endregion

namespace DynConDevCorp.OpenArch.SmartData.BillingDemo1.SmartUIControls
{
    public partial class CustomerControl : UserControl
    {
        #region Constructors

        public CustomerControl()
        {
            InitializeComponent();
            Customer = new SmartEntityLink<Customer>();
            Customer.LinkedEntityChanged += Customer_LinkedEntityChanged;
        }

        #endregion

        #region Public Instance Properties

        [AutoField]
        public SmartEntityLink<Customer> Customer { get; set; }

        #endregion

        #region Public Instance Methods

        public void Customer_LinkedEntityChanged(object sender, EventArgs e)
        {
            bmcCustomer.BoundEntity = Customer.LinkedEntity;
        }

        #endregion
    }
}